package controller

import (
    "fmt"
    "github.com/kataras/iris/v12/context"
    "github.com/kataras/iris/v12/core/router"
)

type DemoController struct {
}

func NewDemoController() *DemoController {
    return &DemoController{}
}

// -------------------------以上初始化时机加载--------------------------

func (c *DemoController) DemoRouterList(app router.Party) {
    app.Get("/DemoById", c.getDemoById)
    app.Post("/Demo", c.postDemo)
    app.Put("/DemoById", c.putDemoById)
    app.Delete("/DemoById", c.deleteDemoById)
}

// -------------------------以上初始化当前Controller路由表--------------------------

func (c *DemoController) getDemoById(ctx context.Context) {
    fmt.Printf("%s", ctx)
}

func (c *DemoController) postDemo(ctx context.Context) {
    fmt.Printf("%s", ctx)
}

func (c *DemoController) putDemoById(ctx context.Context) {
    fmt.Printf("%s", ctx)
}

func (c *DemoController) deleteDemoById(ctx context.Context) {
    fmt.Printf("%s", ctx)
}
